package com.yida.wy.common.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.yida.common.core.xss.Xss;
import com.yida.wy.common.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 基础数据（楼栋）对象
 *
 * @author lqq
 * @date 2023-11-21
 */
@Data
@Table("gwj_base_build")
@ApiModel(value = "基础数据（楼栋信息）对象")
public class WyBaseBuild extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    @ApiModelProperty(value = "楼栋ID")
    private Long buildId;

    @ApiModelProperty(value = "基础小区ID")
    private Long communityId;
    @ApiModelProperty(value = "楼栋名称（必填）")
    private String buildName;

    @ApiModelProperty(value = "建筑总面积")
    private BigDecimal totalSize;

    @ApiModelProperty(value = "期房总面积")
    private BigDecimal periodSize;

    @ApiModelProperty(value = "业主总户数（必填）")
    private Integer totalOwner;

    @ApiModelProperty(value = "其中住宅数")
    private Integer residence;

    @ApiModelProperty(value = "其中非住宅数")
    private Integer nonResidence;

    @ApiModelProperty(value = "地区ID")
    private Long areaId;

    @ApiModelProperty(value = "街道ID")
    private Long streetId;

    @ApiModelProperty(value = "银行ID")
    private Long bankId;

    @ApiModelProperty(value = "拉取数据时的自然幢标识码")
    private String buildCode;

    @ApiModelProperty(value = "总层数")
    private Integer totalLayer;

    @ApiModelProperty(value = "自然幢号")
    private String buildNo;

    @ApiModelProperty(value = "楼栋类型")
    private String buildType;

    @ApiModelProperty(value = "是否为公用户(0=不是,1=是)")
    private String publicFlag;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "公用户创建日期")
    private Date publicCreateTime;

    @ApiModelProperty(value = "开发项目标识码")
    private String projectCode;

    @Column(ignore = true)
    private String communityName;

    @ApiModelProperty(value = "是否是导入自建楼盘 0不是 1是")
    private String importFlag;

    @ApiModelProperty(value = "单元数量")
    private Integer unitTotal;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "交付日期")
    private Date deliverDate;

    @Xss(message = "基础楼栋名称不能包含脚本字符")
    public String getBuildName() {
        return buildName;
    }
}
